package com.aaa.demo04;

/**
 * @author ${崔灿}
 * @date 2022/10/31 17:55
 **/

public class Boy implements Runnable{
    private BankCark bankCark;
    public Boy(BankCark bankCark){
        this.bankCark = bankCark;
    }

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            bankCark.setBalance(bankCark.getBalance() + 1000);
            System.out.println(Thread.currentThread().getName()+"向卡中存入1000，卡中余额："+bankCark.getBalance());
        }
    }
}
